package com.hh.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.annotation.Annotation;

/*较为老的一种方法了*/
public class HelloController implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
        ModelAndView mv=new ModelAndView();

        mv.addObject("hello","hello word");
       /* mv.setViewName("/test/first.jsp");如果没有配置视图解析器就要些全地址，配置好后就不用写了*/
        mv.setViewName("first.jsp");
        return mv;
    }



}
